/**
 * 监控业务配置管理
 */
import request from '@/utils/request';

//列表查询业务
export function querySynchronousBusiness(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/business',
		method: 'post',
		data: data,
	});
}

// 新增业务
export function addSynchronousBusiness(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/business/save',
		method: 'post',
		data: data,
	});
}

// 修改业务
export function editSynchronousBusiness(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/business',
		method: 'put',
		data: data,
	});
}

// 根据id查询业务
export function querySynchronousBusinessById(id: string): ApiPromise<ApiResponse> {
	return request({
		url: '/management/business/' + id,
		method: 'get',
	});
}

// 批量删除业务
export function deleteSynchronousBusinessByIds(ids: string): ApiPromise<ApiResponse> {
	return request({
		url: '/management/business/delete/' + ids,
		method: 'delete',
	});
}

// 批量确认业务
export function confirmByIds(ids: string): ApiPromise<ApiResponse> {
	return request({
		url: '/management/business/confirm/' + ids,
		method: 'get',
	});
}

// 批量取消确认业务
export function cancelByIds(ids: string): ApiPromise<ApiResponse> {
	return request({
		url: '/management/business/cancel/' + ids,
		method: 'get',
	});
}

export function batchImport(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/business/batchImport',
		method: 'post',
		data: data,
	});
}

// 下载专属指标导入模板
export function importTemplate(): ApiPromise<ApiResponse> {
	return request({
		url: '/management/business/importTemplate',
		method: 'get',
		responseType: 'blob',
	});
}

// 下载(导出)专属指标列表
export function download(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/business/download',
		method: 'post',
		data: data,
		responseType: 'blob',
	});
}

// 获取弹框列表
export function queryToImport(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/management/business/queryToImport',
		method: 'post',
		data,
	});
}
